#include <stdio.h>

struct A
{
    unsigned char a : 2;//a只有2个bit大小
    unsigned char b : 4;//b是4个bit大小
    //char b : 4;//b是4个bit大小

};

struct C
{
    char a1 = 1;
    char a2 = 0;
};

int main()
{
    struct A a;
    a.a = 3;
    printf("%x\n", a.a);
    //a.a = 5;
    a.b = 15;
    //a.b = 16;
    printf("%x\n", a.b);
    return 0;
}

